<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>及时达</title>
    <meta name="Keywords" content=""/>
    <meta name="Description" content=""/>
    <link rel="stylesheet" type="text/css" href="/Public/Phone/Style/common.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Phone/Style/style.css"/>
    <script src="/Public/Phone/Js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/Public/Phone/Js/mobile/layer.js" type="text/javascript" charset="utf-8"></script>
    <script src="/Public/Phone/Js/common.js" type="text/javascript" charset="utf-8"></script>
    <script src="/Public/Phone/Js/plugin.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="main main_bg of">
    <div class="login of">
        <div class="login_logo of">
            <img src="/Public/Phone/Images/logo.png"/>
        </div>
        <div class="login_from of">
            <div class="login_input of">
                <label>
                    <div class="login_input_txt of">
                        <i class="iconfont">&#xe630;</i>
                        <span>登录名</span>
                    </div>
                    <div class="login_input_input of">
                        <input type="txt" name="username" id="username" value="" />
                    </div>
                </label>
            </div>
            <div class="login_input of">
                <label>
                    <div class="login_input_txt of">
                        <i class="iconfont">&#xe6a1;</i>
                        <span>密&nbsp;&nbsp;&nbsp;码</span>
                    </div>
                    <div class="login_input_input of">
                        <input type="password" name="password" id="password" value="" />
                    </div>
                </label>
            </div>
            <div class="login_input of">
                <div class="login_checked fl of">
                    <label>
                        <em><i class="iconfont">&#xe638;</i></em>
                        <input type="checkbox" name="rember" id="checkbox" value="1" />
                        <span>记住密码</span>
                    </label>
                </div>
                <div class="login_forget fr of">
                    <a href="忘记密码.html">忘记密码</a>
                </div>
            </div>
            <div class="login_submit of">
                <input type="submit" name="" id="" value="登   录" />
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function(){
        //check
        $('.login_checked label').click(function(){
            if(!$('#checkbox').is(':checked')){
                $(this).children('em').removeClass('active');
            }else{
                $(this).children('em').addClass('active');
            }
        });
        //登录
        $('.login_submit input').click(function () {
            var username = $('#username').val();
            var password = $('#password').val();
            var rember=0;
            if($("#checkbox").is(":checked")){
                 rember=  $("#checkbox").val();
            }
            if(!username){
                layer.open({
                    content: '请输入登录名!'
                    ,skin: 'msg'
                    ,time: 2 //2秒后自动关闭
                });
                return false;
            }
            if(!password){
                layer.open({
                    content: '请输入密码!'
                    ,skin: 'msg'
                    ,time: 2 //2秒后自动关闭
                });
                return false;
            }
            $.ajax({
                type:'post',
                url :"<?php echo U('Login/dologin');?>",
                data:{username:username,password:password,rember:rember},
                dataType:"json",
                success:function (data) {
                    if(data['error']==1){
                        layer.open({
                            content: data.msg
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                        window.location.href=data.url;
                        return false;
                    }else{
                        layer.open({
                            content: data.msg
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                        return false;
                    }
                }
            });
        });
    });
</script>
</html>